<template>
  <div class="form-setting-panel">
    <!-- start 标题 -->
    <h3 class="form-setting-panel-title">{{field.displayName}}</h3>   
    <!-- end 标题 -->
    <p class="form-design-warning">{{$t('common.form.tip.systemTemplateTips')}}</p>
    <div class="form-setting-group">
      <el-checkbox :value="field.setting.autoSerialNumber" @input="update($event, 'autoSerialNumber', true)">{{$t('common.form.tip.setModuleAutoCreateNo', {module:$t('common.form.type.customer')})}}</el-checkbox>
    </div>
    <p class="form-select-logical-tip">{{$t('common.form.preview.text.des6')}}</p>
  </div>
</template>

<script>
import SettingMixin from '@src/component/form/mixin/setting';
import { settingProps } from '@src/component/form/components/props';
import { transformI18n } from '@src/locales'

export default {
  name: 'customer-serial-number-extend-setting',
  mixins: [SettingMixin],
  props: settingProps,
  methods: {
    updateForDom(event){
      let el = event.target;
      let prop = el.dataset.prop;
      let value = el.value;

      this.update(value, prop)
    },
    update(value, prop, isSetting){
      this.$emit('input', {value, prop, isSetting})
      this.field.defaultTips = value ? `${this.field.displayName}${transformI18n('common.form.preview.text.des7', this.formPreviewLocale)}` : ''
    }
  }

}
</script>
